<template>
  <div class="nextTick">
    <h1>This is an NextTick page</h1>
    <p><input type="button" value="按钮" @click="change"><span>{{ msg }}</span></p>
    <Test />
  </div>
</template>

<script>
import Test from '@/components/Test.vue';
export default {
  components:{
    // 组件名: 组件对象
    // Test: Test
    Test
  },
  data(){
    return {
      msg: "hello"
    }
  },
  methods:{
    async change(){
      this.msg = "hi";
      console.log(this.msg);

      // await this.$nextTick();

      this.$nextTick(()=>{
        console.log(document.querySelector("span").innerText);
      });

    }
  }
}
</script>
